#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QLocale>
#include <QTranslator>
//#include <QtWebView/QtWebView>

int main(int argc, char *argv[])
{
    QGuiApplication app(argc, argv);

//    QTranslator translator;
//    const QStringList uiLanguages = QLocale::system().uiLanguages();
//    for (const QString &locale : uiLanguages) {
//        const QString baseName = "VideoDeeper_" + QLocale(locale).name();
//        if (translator.load(":/i18n/" + baseName)) {
//            app.installTranslator(&translator);
//            break;
//        }
//    }

//    QQmlApplicationEngine engine;
//    const QUrl url(u"qrc:/VideoDeeper/main.qml"_qs);
//    QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
//                     &app, [url](QObject *obj, const QUrl &objUrl) {
//        if (!obj && url == objUrl)
//            QCoreApplication::exit(-1);
//    }, Qt::QueuedConnection);
//    engine.load(url);

    QQmlApplicationEngine engine;
    qmlRegisterSingletonType(QUrl("qrc:/VideoDeeper/src/UI/Components/FontAwesome/FAFontLoader.qml"), "DreamLab.Icons", 1, 0, "FAFonts");
    engine.load(QUrl("qrc:/VideoDeeper/src/main.qml"));
    return app.exec();
}
